﻿using ConsoleHoster.Model.Entities;
using System.Collections.ObjectModel;
using System.Windows.Media;

namespace ConsoleHoster.UnitTests
{
	public class TestRepository
	{
		public const string ProjectName1 = "any project name 1";
		public const string ProjectArguments1 = "any arguments";
		public const string ProjectWorkingDirectory1 = "any dir";
		public const string ProjectExecutable1 = "any exe";
		public const string CommandText1 = "Any command test";
		public const string CommandGroup1 = "any command group1";
		public const string CommandName1 = "any command name 1";
		public static Color ProjectCommandColor1 = Colors.Blue;

		public const string ProjectName2 = "any project name 2";
		public const string ProjectArguments2 = "any arguments";
		public const string ProjectWorkingDirectory2 = "any dir";
		public const string ProjectExecutable2 = "any exe";
		public const string CommandText2 = "Any command test";
		public const string CommandGroup2 = "any command group2";
		public const string CommandName2 = "any command name 2";
		public static Color ProjectCommandColor2 = Colors.Blue;

		private readonly ObservableCollection<CommandData> project1Commands;
		private readonly ObservableCollection<CommandData> project2Commands;
		private readonly ConsoleProject consoleProject1;
		private readonly ConsoleProject consoleProject2;
		private readonly CommandData command1;
		private readonly CommandData command2;

		public TestRepository()
		{
			this.command1 = new CommandData()
			{
				CommandColor = ProjectCommandColor1,
				CommandText = CommandText1,
				GroupName = CommandGroup1,
				Name = CommandName1,
				IsFinal = Command1IsFinal
			};
			this.command2 = new CommandData()
			{
				CommandColor = ProjectCommandColor2,
				CommandText = CommandText2,
				GroupName = CommandGroup2,
				Name = CommandName2,
				IsFinal = Command2IsFinal
			};

			this.project1Commands = new ObservableCollection<CommandData>(new[] { Command1, Command2 });
			this.project2Commands = new ObservableCollection<CommandData>();

			this.consoleProject1 = new ConsoleProject()
			{
				Name = ProjectName1,
				Arguments = ProjectArguments1,
				Commands = Project1Commands,
				Executable = ProjectExecutable1,
				WorkingDir = ProjectWorkingDirectory1,
				AutoLoad = Project1AutoLoad,
				BackgroundColor = Project1BackgroundColor,
				CaretColor = Project1CaretColor,
				ErrorMessageColor = Project1ErrorMessageColor,
				IsEditable = Project1IsEditable,
				MessageColor = Project1MessageColor,
				ProjectColor = Project1Color,
				ShowExplorerByDefault = Project1ShowExplorerByDefault
			};
			this.consoleProject2 = new ConsoleProject()
				{
					Name = ProjectName2,
					Arguments = ProjectArguments2,
					Commands = Project2Commands,
					Executable = ProjectExecutable2,
					WorkingDir = ProjectWorkingDirectory2,
					AutoLoad = Project2AutoLoad,
					BackgroundColor = Project2BackgroundColor,
					CaretColor = Project2CaretColor,
					ErrorMessageColor = Project2ErrorMessageColor,
					IsEditable = Project2IsEditable,
					MessageColor = Project2MessageColor,
					ProjectColor = Project2Color,
					ShowExplorerByDefault = Project2ShowExplorerByDefault
				};
		}

		public bool Project1AutoLoad
		{
			get
			{
				return true;
			}
		}

		public bool Project2AutoLoad
		{
			get
			{
				return false;
			}
		}

		public ObservableCollection<CommandData> Project1Commands
		{
			get
			{
				return this.project1Commands;
			}
		}

		public ObservableCollection<CommandData> Project2Commands
		{
			get
			{
				return this.project2Commands;
			}
		}

		public ConsoleProject ConsoleProject1
		{
			get
			{
				return this.consoleProject1;
			}
		}

		public ConsoleProject ConsoleProject2
		{
			get
			{
				return this.consoleProject2;
			}
		}

		public CommandData Command1
		{
			get
			{
				return this.command1;
			}
		}

		public CommandData Command2
		{
			get
			{
				return this.command2;
			}
		}

		public bool Command1IsFinal
		{
			get
			{
				return false;
			}
		}

		public bool Command2IsFinal
		{
			get
			{
				return true;
			}
		}

		public Color Project1BackgroundColor
		{
			get
			{
				return Colors.Red;
			}
		}

		public Color Project2BackgroundColor
		{
			get
			{
				return Colors.Green;
			}
		}

		public Color Project1CaretColor
		{
			get
			{
				return Colors.Yellow;
			}
		}

		public Color Project2CaretColor
		{
			get
			{
				return Colors.Purple;
			}
		}

		public Color Project1ErrorMessageColor
		{
			get
			{
				return Colors.Gray;
			}
		}

		public Color Project2ErrorMessageColor
		{
			get
			{
				return Colors.Blue;
			}
		}

		public bool Project1ShowExplorerByDefault
		{
			get
			{
				return true;
			}
		}

		public bool Project2ShowExplorerByDefault
		{
			get
			{
				return false;
			}
		}

		public Color Project1Color
		{
			get
			{
				return Colors.GreenYellow;
			}
		}

		public Color Project2Color
		{
			get
			{
				return Colors.BlueViolet;
			}
		}

		public Color Project1MessageColor
		{
			get
			{
				return Colors.BlanchedAlmond;
			}
		}

		public Color Project2MessageColor
		{
			get
			{
				return Colors.Brown;
			}
		}

		public bool Project1IsEditable
		{
			get
			{
				return true;
			}
		}

		public bool Project2IsEditable
		{
			get
			{
				return false;
			}
		}
	}
}
